<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1 {
            color: red;
        }
        .div1 {
            width: 100%;
            height: 300px;
            background-color: #ff0000;
            line-height: 300px;
            text-align: center;
        }
        .div2 {
            width: 100%;
            height: 600px;
            background-color: blue;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="div1">这是一段垂直居中，且水平居中的文字</div>
    <div class="div2"><img src="./imgs/cat.jpg" alt="cat" ></div>
    <input type="text" value="这是一个input">
</body>
</html>